const apiurl="https://www.51houniao.com/";

const pagedata={
    request(url,data,type){
        wx.showLoading({
          title: '加载中...',
        })

        return new Promise((resolve,reject)=>{
            wx.request({
              url: apiurl+url,
              method:type,
              data:data,
              success:(res)=>{
                  wx.hideLoading()
                  resolve(res);
              },
              fail:(err)=>{
                  wx.hideLoading()
                  reject(err);
              }
            })
        })
    }
}
module.exports={
    request:pagedata.request
}